/**
 * 文件描述如下：
 * 1. 对设备监控的信息进行处理
 * 2.
 * 3.
 * 4.
 */
export const deviceName = {
  0: 'RSU',
  1: 'RSU',
  2: '摄像机',
  3: '毫米波雷达',
  4: '激光雷达',
  5: '信号机',
  6: '其他设备',
}

export const faultTypes = {
  0: '摄像机故障',
  1: '毫米波故障',
  3: '激光雷达故障',
  4: '其它',
}

const status = [
  { name: 'mec联网状态', value: '', key: 'active' },
  { name: 'mec在线状态', value: '', key: 'rsu-status' },
]

export const dataPro_software = (params) => {
  console.log(params)

  status.forEach((item) => {
    item.value = params['status'][item.key]
  })

  const vecFaultInfo = params['vec-fault-info']?.map((item, index) => ({ ...item, name: 'fault_' + (index + 1) }))
  const vecRsuStatus = params['vec-rsu-status']?.map((item, index) => ({ ...item, name: 'rsu_' + (index + 1) }))
  const vecSensorStatus = params['vec-sensor-status']?.map((item, index) => ({ ...item, name: 'sensor_' + (index + 1) }))
  return { status, vecFaultInfo, vecRsuStatus, vecSensorStatus }
}
